package com.utooo.controller;


import com.utooo.constant.ResultCodeConstant;
import com.utooo.pojo.dto.common.CreateGroup;
import com.utooo.pojo.dto.common.RestResult;
import com.utooo.pojo.dto.invoice.InvoicePushDto;
import com.utooo.pojo.dto.supplier.execution.PurchasePushDto;
import com.utooo.service.supplier.SupplierInvoiceService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @Description: 发票同步控制层
 * @Author SJD
 * @Date: 2025/4/25 11:32
 * @Copyright: 南京优通信息科技股份有限公司
 */
@Tag(name = "供应商-发票同步控制层")
@RequestMapping("/invoice")
@RestController
@RequiredArgsConstructor
public class InvoiceSyncController {

    private final SupplierInvoiceService invoiceServiceImpl;
    @RequestMapping(value = "/pushInvoice", method = RequestMethod.POST)
    @Operation(summary = "供货方推送发票到采货方票夹")
    @ResponseBody
    public RestResult<Boolean> pushInvoice(@RequestBody @Validated(CreateGroup.class) InvoicePushDto param) {
        Boolean result = invoiceServiceImpl.pushInvoice(param);
        return new RestResult<>(ResultCodeConstant.CODE_200, ResultCodeConstant.CODE_200_MSG, result);
    }
}
